<template>
	<view class="mainBg h100 container">
		<navbar title="微信号">
			<text @click="save">保存</text>
		</navbar>
		<uni-easyinput v-model="wx" placeholder="请输入" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				wx: ''
			}
		},
		onLoad({
			wx
		}) {
			this.wx = wx
		},
		methods: {
			save() {
				this.$post("/user/updateWx", {
					wx: this.wx
				}).then(res => {
					this.$toast(res.msg)
					if (res.code == 200) {
						setTimeout(() => {
							uni.navigateBack()
						}, 500)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #35CBAD;
	}
</style>